package edu.gatech.teamrocket;

import edu.gatech.teamrocket.models.Auth;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;

/**
 * The initial activity loaded by the application. Currently redirects to the login screen.
 * @author Patrick
 *
 */
public class DewActivity extends Activity {
	DewApplication app;
	Auth auth;
	
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
		app = (DewApplication) getApplicationContext();
		auth = app.getAuth();
		Intent i;
        if (!auth.check()) { // redirect if not authenticated
        	i = new Intent(getApplicationContext(), LoginActivity.class); // get the activity for the login form
        } else {
        	i = new Intent(getApplicationContext(), ListActivity.class); // get the activity for the lists
        }
        startActivity(i);
    }
}